//https://codeforces.com/contest/231/submission/278349728

#include <bits/stdc++.h> 
using namespace std;

const int mod = 2e5+10;
typedef long long ll;
typedef unsigned long long ull;
#define x first
#define y second
typedef pair<int, int> P;

ll a[mod];

void solve() {
	int n, k, i, l = 0; 
	long long sum = 0; 
	pair<int, int> ans;
	
	cin >> n >> k;
	for (i = 0; i < n; ++i) cin >> a[i];
	sort(a, a + n);

	for (i = 0; i < n; ++i) {
		sum += a[i];
		while (1LL * (i - l + 1) * a[i] > sum + k) sum -= a[l++];
		ans = max(ans, { i - l + 1, -a[i] });
	}
	
	cout << ans.first << ' ' << -ans.second << endl;
}

int main() {    
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
    cout.tie(NULL); 

	int _ = 1;
	while(_--) solve();

	return 0;
}